package com.cloudfun.campusshare.common.security;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Huqin on 2019/12/23
 */
@Configuration
public class AuthFilterConfiguration {

    @Bean
    public FilterRegistrationBean<AuthenticationFilter> filterRegistrationBean(AuthenticationFilter authenticationFilter) {
        FilterRegistrationBean<AuthenticationFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(authenticationFilter);
        bean.addUrlPatterns("/*");
        return bean;
    }

}
